/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package seso;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.geom.RoundRectangle2D;
import java.awt.GradientPaint;

/**
 *
 * @author Administrator
 */
public class RMiddleProgTitle extends javax.swing.JTextField {

    private final int arcWH = 8;

    public RMiddleProgTitle() {
        super();

        setOpaque(true);
        setBackground(new Color(120, 141, 83));
    }

    @Override
    protected void paintComponent(Graphics g) {
        Graphics2D g2d = (Graphics2D) g;
        int width = getWidth();
        int height = getHeight();

        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        RoundRectangle2D.Double rect = new RoundRectangle2D.Double(0, 0, width, height, arcWH, arcWH);
        g2d.setClip(rect);

        //GradientPaint gp = new GradientPaint(0.0F, 0.0F, new Color(120, 141, 83), 0.0F, height, new Color(120, 141, 83), false);
        //g2d.setPaint(gp);
        //g2d.fillRoundRect(1, 1, width - 2, height - 2, arcWH, arcWH);

        super.paintComponent(g);
    }

    @Override
    protected void paintBorder(java.awt.Graphics g) {
        RoundRectangle2D.Double rect;
        Graphics2D g2d = (Graphics2D) g;
        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

        int width = getWidth();
        int height = getHeight();

        g2d.setColor(Color.WHITE);
        rect = new RoundRectangle2D.Double(2, 2, width - 5, height - 5, arcWH, arcWH);
        g2d.draw(rect);
    }
}
